package com.baliejun.springsell.service;

import com.baliejun.springsell.bean.ProductInfo;
import com.baliejun.springsell.dto.OrderCartDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @Author: LiejunBa
 * @Description:
 * @Date: 2020/12/2 3:12 下午
 */
public interface ProductInfoService {

    ProductInfo findOne(String productId);

    //查询所有上架商品
    List<ProductInfo> findUpAll();

    Page<ProductInfo> findAll(Pageable pageable);

    //保存商品信息
    ProductInfo save(ProductInfo productInfo);

    //加库存
    void increaseStock(List<OrderCartDTO> orderCartDTOList);

    //减库存
    void decreaseStock(List<OrderCartDTO> orderCartDTOList);

}
